package com.donger.business.modules.upms.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.donger.business.modules.upms.entity.SysUser;
import com.donger.business.modules.upms.vo.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 系统用户 Mapper 接口
 * </p>
 *
 * @author xyx
 * @since 2019-01-12
 */
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {


    /**
     * 根据用户ID 查询用户权限
     *
     * @param userId 用户ID
     * @return 用户权限列表
     */
    List<String> findPermissionsByUserId(@Param("userId") Long userId);


    /**
     * 分页查询所有的用户
     *
     * @param page
     * @param queryWrapper
     * @return
     */
    IPage<UserVo> getUserPage(Page page, @Param(Constants.WRAPPER) Wrapper queryWrapper);


}
